/* 获取 sql 目录下的文件目录数据 */
const fs = require('fs')
const path = require('path')

const walkFile = require('./walk-file')

/**
 * 获取sql目录下的文件目录数据
 * @return {object}
 */
function getSqlMap() {
  // let basePath = __dirname.replace(/\\/g, '/')

  // let pathArr = basePath.split('/')

  // pathArr = pathArr.splice(0, pathArr.length - 1)
  // basePath = pathArr.join('/') + '/sql/'
  const basePath = path.resolve(__dirname, '../../sql/')

  const fileList = walkFile(basePath, 'sql')
  return fileList
}

module.exports = getSqlMap
